Basic Export To EXCEL

I'm looking to do a BASIC export to excel with a few modifications. I'm using the built in DXL thats in the dxl library to export my module to excel but theres two things I want to also add.

1) merge specific cells
2) adjust the width of specific columns in excel

I found this online:

/*
* Merges all cells in the desired range.
*/
bool setRangeMergeCells(int startRow, int startCol, int endRow, int endCol, bool mergeCells) {
if(getCellRange(startRow, startCol, endRow, endCol)) {
if(!checkResult(olePut(objRange, cPropertyMergeCells, mergeCells))) {
errorBox("Failed to set property MergeCells for range");
return(false);
}

return(true);
}

return(false

and
/* Sets the specified column to the specified width.
* One thing to keep in mind is that while this function specifies the columns with
* in characters, DOORS stores its column width as the number of pixels on the screen.
*
* If you wish to set the Excel column width to somewhere near the width that it had in
* DOORS, I have found that using width(Column c)/6 works fairly well.
*/
bool setExcelColumnWidth(int columnNumber, int columnWidth) {
// get a handle to the column.
if(!getColumn(columnNumber)) {
return(false);
}

// set the column width
if(!checkResult(olePut(objColumn, cPropertyColumnWidth, columnWidth))) {
errorBox("Failed to set column " intToCol(columnNumber) "s width to " columnWidth "");
return(false);
}

return(true);

but i'm not sure how to apply this to my code. My export to excel code, as of right now, is pretty much the built in "export to excel via automation" dxl code in the dxl library with a few modifications I've made. I also don't want to use the "enhanced export to excel" code, its just too much options and functions I don't need.
phan423 - Tue Mar 06 20:47:18 EST 2012

Re: Basic Export To EXCEL
phan423 - Wed Mar 07 21:27:37 EST 2012

I was able to figure out how to merge cells, adjust width of columns and do text wrap. Last question, how do I bypass all those warning messages automatically when I merge cells

"The selection contains multiple data values. Merging into one cell will keep the upper-left most data only."

Is there a way to adjust it so the warning doesn't come out? Or maybe have it automatically press "enter" each time it pops up?

Re: Basic Export To EXCEL
andreimiculita - Fri Aug 25 04:47:13 EDT 2017

Hello

I know this is a long shot, but if you recall how you figured out how to merge, adjust widths and enable wrapping, I'd like to know as well.

Thanks in advance, hoping you'll see this.